package com.feshfans;

import com.feshfans.byteconvert.convertor.LongConvertor;
import com.feshfans.byteconvert.convertor.ShortConvertor;
import com.feshfans.byteconvert.data.TestData;
import com.feshfans.byteconvert.data.TestData2;
import ognl.Ognl;
import ognl.OgnlContext;
import ognl.OgnlException;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args ) throws OgnlException {

//        Byte[] src = new Byte[32];
//        TestData test = new TestData(src);
//        OgnlContext context = new OgnlContext();
//        context.put("num",2);
//        context.put("count",3);

        byte[] bytes = new byte[]{1,2,3,'k','a','n','g','h','u'};

        try {
            TestData2 data2 = new TestData2();
            data2.fromBytes(bytes);
            System.out.println(data2.getB());
            System.out.println(data2.getS());
            System.out.println(data2.getStr());

            ShortConvertor convertor = new ShortConvertor();
            System.out.println(convertor.fromBytes(new byte[]{2,3}));


            TestData2 testData2 = new TestData2();

        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }


//        System.out.println(test.getClass().getSuperclass());
//        System.out.println(ArrayList.class.getSuperclass());
//        System.out.println(ArrayList.class.isInstance(List.class));
//        System.out.println(ArrayList.class.isAssignableFrom(List.class));
//        System.out.println(List.class.isAssignableFrom(ArrayList.class));
    }
}
